'''

'''
import redis

client = redis.Redis(host='116.62.46.50', port=6379, password='smile123')
if client.ping():
    # client.set('py1', '哈哈')
    # print(client.ttl('py1'))
    # print(client.get('py1').decode())
    # client.set('py2', 'ok2')
    # print(client.get('py1'))
    # client.lpush('list1', 10, 20, 30)
    # client.lrem('list1',1, 30)
    # client.lrem('list1',3, 10)
    # list1 = client.lrange('list1', 0, -1)
    # print(list(map(int, list1)))
    # client.sadd('pyset', 10, 20, 30, 40)
    # print(client.smembers('set1'))
    client.zadd('pyz1', {
        'py1': 100,
        'py2': 50,
        'py3': 60
    })
    items = client.zrevrange('pyz1', 0, -1)
    print(items)
    print(list(map(bytes.decode, items)))
    print(client.zscore('pyz1', 'py2'))
else:
    print('not successful')


